<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.20.0/axios.js"></script>
</head>

<body>
  <script>
    // console.log(axios);

    axios.defaults.baseURL = 'https://api-hmugo-web.itheima.net/api/public/v1';
    // axios 基本用法
    axios({
      method: 'GET',
      url: '/home/swiperdata'
    }).then(res => {
      console.log(res.data);
    });


    // axios get 参数传递 params
    axios({
      method: 'GET',
      url: '/goods/search',
      params: {
        query: '华为'
      }
    }).then(res => {
      console.log(res.data);
    });


    axios({
      method: 'POST',
      url: '/users/wxlogin',
      data: {
        encryptedData: 'xxx',
        rawData: 'xxx',
        iv: 'xxx',
        signature: 'xx',
        code: 'xxx'
      }
    }).then(res => {
      console.log(res.data);
    });




  </script>
</body>

</html>